<?php
/**
 * RedCross Application
 *
 * @copyright Copyright (c) 2010, Kristian Stokke Tryggestad, Rune Vikestad, Andreas Flaten Wist, Simen Nicolai Echholt, Ole Henrik Jahren
 */

/**
 * Form for filtering what statistics to be shown on the
 * statistics page showing work hours
 *
 * @category    RedCross
 * @package     Admin_Form_Shift
 */
class Admin_Form_Statistics_ByMemberFilter extends Admin_Form_Statistics_DateFilter
{
	
	public function init()
	{
		parent::init();
        
		$this->addElement('text', 'member_name', array(
			'required'      => false,
			'label'         => 'Medlemsnavn inneholder'
		));
		
		$this->addElement('hidden', 'sortby');
		$this->addElement('hidden', 'sortorder');
		
		$this->addSubmitButton();
	}
	
	public function fillForm($values)
	{
		parent::fillForm($values);
		if (array_key_exists('member_name', $values))
			$this->getElement('member_name')->setValue($values['member_name']);
		if (array_key_exists('sortby', $values))
			$this->getElement('sortby')->setValue($values['sortby']);
		if (array_key_exists('sortorder', $values))
			$this->getElement('sortorder')->setValue($values['sortorder']);
	}
}